package com.lmm.yydshtester;

import com.lmm.yydshtester.distributed.TaskExecutor;
import com.lmm.yydshtester.distributed.WorkerNode;
import com.lmm.yydshtester.zk.SnowflakeIdGenerator;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@Slf4j
@SpringBootApplication
public class WorkerApplication {

	public static void main(String[] args) {
		SpringApplication.run(WorkerApplication.class, args);

		String workId = WorkerNode.getSingleton().getId();
		log.info("节点已经启动，workId = " + workId);

		SnowflakeIdGenerator.setWorkerId(workId);
		SnowflakeIdGenerator.getSingleton();
		TaskExecutor.getSingleton().startMoniter();
	}

}
